
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Content Def</title>         
    </head>
    <body>
    
    

	<g:form url="[action:'saveContentDef']" method="post" >
	<table>
		<tr><td>Name</td>
		    <td>  <input type="text" name="name" value="${fieldValue(bean:contentDefHolder,field:'name')}"/>
		      
	
		</td>
		</tr>

		<tr><td>description</td>
		<td> <input type="text"   name="description" value="${fieldValue(bean:contentDefHolder,field:'description')}"/>
		</td>
		</tr>
		

		
	
		

		
				</table>
			<input value="save content def" type="submit" />
		</g:form>
		
		
		
	<g:form url="[action:'addAttribute']" method="post" >
		  <input type="hidden" iname="id" value="${fieldValue(bean:contentDefRequest,field:'contentDefId')}"/>
		  
		  
	  <input type="hidden"  name="contentDefId" value="${fieldValue(bean:contentDefRequest,field:'contentDefId')}"/>
	  
	  

            
	<table>


		<tr><td>attributeName</td>
			<td> <input type="text" name="name" value="${fieldValue(bean:attributeHolder,field:'name')}"/>
		</td>
		</tr>
		

		
				<tr><td>attributeDescription</td>
		<td> <input type="text"  name="description" value="${fieldValue(bean:attributeHolder,field:'description')}"/>
		</td>
		</tr>
		
				<tr><td>Mime Type</td>
		<td> <input type="text"  name="mimeType" value="${fieldValue(bean:attributeHolder,field:'mimeType')}"/>
		</td>
		</tr>
		
				
		
					<tr><td>valueType</td>
		<td> 
		
		
		  <select name="valueType" >
<option value="String" >String</option>
<option value="Integer">Integer</option>

<option value="Boolean" >Boolean</option>
<option value="Binary" >Binary</option>
</select>
		<p>This list is not dynamic, if you add a new attribute value type, you will have to add it manually here </p>
		
		
		</td>
		</tr>			
		
					<tr><td>Required</td>
					
					   
		<td>   <g:checkBox name="required" value="${attributeHolder?.required}" ></g:checkBox>
		</td>
		</tr>			

		
		
		
				</table>
			<input value="add attribute" type="submit" />
		</g:form>
		
				
		<h2>Attributes</h2>
                    <g:each in="${contentDefHolder.attributeHolders}" status="i" var="attributeHolderInstance">

                       
              	  <g:each in="${attributeHolderInstance.attributeHolder}"  var="ah">

                   		<li>${ah.name}  ${ah.mimeType} 	<g:link action="removeAttribute"  params="[contentDefId:contentDefHolder.id,attributeId:ah.id]">remove</g:link></li>    
                  
       
                   		
                   		
                   	
                   		
                   		
                   		
                   		  </g:each>
                   		
                   		     
          
                    </g:each>
                    
</body>
</html>
                    
                    
                    
                    		